package com.gitee.wsl.unit.length

import com.gitee.wsl.unit.UnitType

sealed interface LengthUnitType: UnitType<Double> {

    data object M: LengthUnitType {
        override val baseUnit: Double = 1.0
    }

    data object KM: LengthUnitType {
        override val baseUnit: Double = M.baseUnit *1000
    }

    //分米(dm)
    data object DM: LengthUnitType {
        override val baseUnit: Double = M.baseUnit *0.1
    }
    //厘米(cm)
    data object CM: LengthUnitType {
        override val baseUnit: Double = DM.baseUnit *0.1
    }
    //毫米(mm)
    data object MM: LengthUnitType {
        override val baseUnit: Double = CM.baseUnit *0.1
    }
    //丝(机械尺寸单位)
    data object SHI: LengthUnitType {
        override val baseUnit: Double = MM.baseUnit *0.01
    }
    //微米(μm)
    data object UM: LengthUnitType {
        override val baseUnit: Double = SHI.baseUnit *0.1
    }
    //纳米(nm)
    data object NM: LengthUnitType {
        override val baseUnit: Double = UM.baseUnit *0.001
    }
     //皮米(pm)
     data object PM: LengthUnitType {
        override val baseUnit: Double = NM.baseUnit *0.001
    }

    //------英制----------------
    //海里(nmi)
    data object NMI: LengthUnitType {
        override val baseUnit: Double = M.baseUnit * 1851.8518
    }

    //英寻(fm)
    data object FM: LengthUnitType {
        override val baseUnit: Double = M.baseUnit * 1.8288
    }

    //英尺(ft)
    data object FT: LengthUnitType {
        override val baseUnit: Double = M.baseUnit * 0.3048
    }

    //英寸(in)
    data object IN: LengthUnitType {
        override val baseUnit: Double = M.baseUnit * 0.0254
    }

    //英里(mi)
    data object MI: LengthUnitType {
        override val baseUnit: Double = M.baseUnit * 1609.2693
    }

    //弗隆(fur)

    //码(yd)
    data object YD: LengthUnitType {
        override val baseUnit: Double = M.baseUnit * 0.914399
    }

    //密耳(mil)

    //---------市制------------------
    //里
    data object 里: LengthUnitType {
        override val baseUnit: Double = M.baseUnit *500
    }
    //丈
    data object 丈: LengthUnitType {
        override val baseUnit: Double = M.baseUnit *3.333
    }
    //尺
    data object 尺: LengthUnitType {
        override val baseUnit: Double = 丈.baseUnit *0.1
    }
    //寸
    data object 寸: LengthUnitType {
        override val baseUnit: Double = 尺.baseUnit *0.1
    }
    //分
    data object 分: LengthUnitType {
        override val baseUnit: Double = 寸.baseUnit *0.1
    }
    //厘
    data object 厘: LengthUnitType {
        override val baseUnit: Double = 分.baseUnit *0.1
    }
    //毫
    data object 毫: LengthUnitType {
        override val baseUnit: Double = 厘.baseUnit *0.1
    }
}